package 蓝桥第二期2024;
import java.util.Scanner;

public class task4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String user = sc.next();
        String equ = "";
        int index = 0;
        for (int i = 0; i < user.length(); i++) {
            char cr = user.charAt(i);
            if (cr == 'L'){
                equ += 'L';
                index = i;
            }
        }for (int i = index; i < user.length(); i++) {
            char cr = user.charAt(i);
            if (cr == 'A'){
                equ += 'A';
                index = i;
            }
        }for (int i = index; i < user.length(); i++) {
            char cr = user.charAt(i);
            if (cr == 'N'){
                equ += 'N';
                index = i;
            }
        }for (int i = index; i < user.length(); i++) {
            char cr = user.charAt(i);
            if (cr == 'Q'){
                equ += 'Q';
                index = i;
            }
        }for (int i = index; i < user.length(); i++) {
            char cr = user.charAt(i);
            if (cr == 'I'){
                equ += 'I';
                index = i;
            }
        }for (int i = index; i < user.length(); i++) {
            char cr = user.charAt(i);
            if (cr == 'A'){
                equ += 'A';
                index = i;
            }
        }for (int i = index; i < user.length(); i++) {
            char cr = user.charAt(i);
            if (cr == 'O'){
                equ += 'O';
                index = i;
            }
        }
        String auo = "LANQIAO";
        if (equ.equals(auo)){
            System.out.println("YES");
        }else {
            System.out.println("NO");
        }
    }
}
